<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>

<div id="app">

    <el-table
            :data="tableData"
            style="width: 100%">
        <el-table-column
                prop="date"
                label="日期"
                width="500">
        </el-table-column>
        <el-table-column
                prop="name"
                label="姓名"
                width="500">
        </el-table-column>
        <el-table-column
                prop="address"
                label="地址">
        </el-table-column>
        <el-table-column label="操作" align="center">
            <template slot-scope="scope">

                <el-button type="primary" icon="el-icon-edit" circle @click="handleUpdate(scope.row)"></el-button>
                <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)"></el-button>

            </template>
        </el-table-column>
    </el-table>

</div>

<script>
    new Vue({
        el: '#app',
        data: {
            tableData: [
                {date: '2000.02.02', name: '张三', address: '上海'},
                {date: '2000.12.12', name: '李四', address: '北京'}
            ]
        },
        methods: {
            handleUpdate(row) {
                alert(row.name);
                row.name='王五'
            },
            handleDelete(row) {
                alert(row.date);
            }
        }
    })
</script>

</body>
</html>